/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file    tim.h
  * @brief   This file contains all the function prototypes for
  *          the tim.c file
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2024 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __TIM_H__
#define __TIM_H__

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "main.h"

/* USER CODE BEGIN Includes */
#include "dwt_stm32_delay.h"
/* USER CODE END Includes */

extern TIM_HandleTypeDef htim1;

extern TIM_HandleTypeDef htim3;

/* USER CODE BEGIN Private defines */
#define delay_ms(a) DWT_Delay_us(a*1000)
/* USER CODE END Private defines */

void MX_TIM1_Init(void);
void MX_TIM3_Init(void);

void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim);

/* USER CODE BEGIN Prototypes */
#define CODE_1       (61)       //1码定时器计数次数
#define CODE_0       (28)       //0码定时器计数次数

/*建立�?????个定义单个LED三原色�?�大小的结构�?????*/



#define Pixel_NUM 53  //LED数量宏定义，这里我使用一个LED，（单词pixel为像素的意�?�）



void Reset_Load(void); //该函数用于将数组�?????�?????24个数据变�?????0，代表RESET_code
void RGB_SendArray(void);          //发�?�最终数�?????
void WS281x_Show_All(uint8_t red, uint8_t green, uint8_t blue);
void WS281x_SetPixelRGB(uint16_t n ,uint8_t red, uint8_t green, uint8_t blue);
void WS281x_SetPixelColor(uint16_t n, uint32_t GRBColor);
uint32_t WS281x_Color(uint8_t red, uint8_t green, uint8_t blue);
void WS2812C_CloseALL(void);
void WS2812x_ChargePrecoss(uint16_t num);
void WS281x_TheaterChaseRainbow(uint8_t wait);
void WS281x_TheaterChase(uint32_t c, uint8_t wait) ;
void WS281x_RainbowCycle(uint8_t wait);
void WS281x_Rainbow(uint8_t wait);
void WS281x_ColorWipe(uint32_t c, uint8_t wait);
uint32_t WS281x_Wheel(uint8_t wheelPos);
void WS281x_Show_SetNum(uint8_t red, uint8_t green, uint8_t blue,uint16_t num);

/* USER CODE END Prototypes */

#ifdef __cplusplus
}
#endif

#endif /* __TIM_H__ */

